#pragma once
#include <irrlicht.h>
#include "Utils.h"
#include "iostream"
#include "time.h"

#define PI 3.14159265f

#define TOTAL_SPELLS 21
#define MAX_SPELLS 30
#define MAX_ACTORS 30
#define MAX_DAMAGE 30

#define GK_CROUCH 0
#define GK_UP 1
#define GK_DOWN 2
#define GK_LEFT 3
#define GK_RIGHT 4
#define GK_JUMP 5
#define GK_EXIT 6
#define TOTAL_KEYS 7

#define MOUSE_SENS 4.0f

#define SPEED_MOVE 0.40f
#define SPEED_CROUCH 0.40f
#define SPEED_JUMP 0.40f
#define SPEED_GRAVITY -0.001f
#define FRICTION 30.0f

#define SPELL_SCALE_X 1
#define SPELL_SCALE_Y 1
#define SPELL_SCALE_Z 1
#define SPELL_SPEED 500
#define SPELL_RADIUS 1

enum eState 
{
	 STATE_INIT					=0,
	 STATE_MAIN_MENU_LOADING	=1,
	 STATE_MAIN_MENU			=2,
	 STATE_GAME_LOADING			=3,
	 STATE_GAME					=4,
	 STATE_GAME_END				=5
};

enum eType  
{
	eT_Enemy			=0,
	eT_Friend			=1,
	eT_Spell			=2,
	eT_SpellEffect		=3,
	eT_Player			=4
};

enum eSpell 
{
    eS_FireBolt			= 0,
    eS_FireBall			= 1,
    eS_FireWall			= 2,
    eS_IceShield		= 3,
    eS_FrostNova		= 4,
    eS_FrostBolt		= 5,
    eS_GustWind			= 6,
    eS_LightningBolt	= 7,
    eS_ChainLightning	= 8,
    eS_StoneSpike		= 9,
    eS_Tremor			= 10,
    eS_WallMud			= 11,
    eS_Decay			= 12,
    eS_DrainLife		= 13,
    eS_PWDeath			= 14,
    eS_RaiseSkeleton	= 15,
    eS_BoneArmor		= 16,
    eS_Revive			= 17,
    eS_SElemental		= 18,
    eS_SLesserDemon		= 19,
	eS_SMajorDemon		= 20
};

struct Vector3
{
	float x;
	float y;
	float z;
};

struct sStats
{
	long   nMaxMana;
	long   nMaxHealth;
	long   nCurrentMana;
	long   nCurrentHealth;
	eSpell eCurrentSpell;
	long   nSpellProgress;
	long   nExperience;
	long   nLevel;
	long   nNeededExpToNextLevel;
	float  dCastingTime;
	float  dTotalCastingTime;
};

using namespace std;
using namespace irr;
using namespace core;

class Global
{
public:
	static video::IVideoDriver * driver;
	static IrrlichtDevice * device;
	static IrrlichtDevice * deviceMenu;
	static irr::ILogger * logger;
};
